package election.dev;

import java.net.InetAddress;

import election.api.OpSpawn;
import election.api.Put;


public class Bless extends OpSpawn
{
    static String[] blessings = {"Adidas sweater", "Garfield cat", "iPad2", "Thinkpad T420", "a job offer", "kiss",
        "J-20", "Girlfriend", "PhD degree", "prince frog", "Rou Bao Zi"}; 
    
    @Override
    public void apply(Put exit) throws Exception
    {
        System.out.print("apply Bless ...");
        for (int i = 0; i < 3; i++) {
            int index = (int)System.currentTimeMillis() % blessings.length;
            String blessing = InetAddress.getLocalHost().getHostName() + " wants a " + blessings[index];
            exit.put(blessing);
        }
        System.out.println("done");
    }
    
    
    @Override
    public Stateness getStateness()
    {
        // TODO Auto-generated method stub
        return null;
    }
    

}
